package com.ws.boot.demo.validate.validation.annotation;

import com.ws.boot.demo.validate.validation.validator.UniqueValidator;
import com.ws.boot.validate.annotation.Constraint;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 唯一注解 .
 *
 * @className: Unique
 * @author: ws
 * @date: 2020/4/8 14:01
 * @version: 1.0.0
 */
@Target({ FIELD, TYPE_USE })
@Retention(RUNTIME)
@Constraint(validatedBy = UniqueValidator.class)
public @interface Unique {

    Class<?>[] groups() default { };

    String message() default "{ws.validation.constraints.unique.message}";

    String parameterKey() default "";
}
